package com.example.springdemo.components.aspects;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

//@Aspect
//@Component
public class CalculateAspect {
    @Pointcut("execution(* com.example.springdemo.service.ICalculateService.*(..))")
    public void pointcut() {
    }

    @Before("pointcut()")
    public void before() {
        System.out.println("前置通知");
    }

    @After("pointcut()")
    public void after() {
        System.out.println("后置通知");
    }
}















